package com.example.demo.mapper;

import com.example.demo.entity.TComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wzz
 * @since 2023-09-24
 */
public interface TCommentMapper extends BaseMapper<TComment> {
@Select("select c.*,u.nickname,u.avatar from t_comment c left join sys_user u on c.user_id = u.id where c.article_id = #{articleId}")
    List<TComment> findTree(@Param("articleId") Integer articleId);
}
